﻿/*----------------------------------------------------------------
// Copyright (C) 2011 上海
// 版权所有。 
//
// 文件名：RefrigerationInfo
// 文件功能描述：制冷业务逻辑层
//
// 
// 创建标识：2012-07-28 王冲
//
// 修改标识：
// 修改描述：
//
//
//----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAO.WaiGaoQiao;
using System.Data;

namespace Model.WaiGaoQiao
{
    public class RefrigerationInfo
    {
        public string T1
        {
            get;
            set;
        }
        public string T2
        {
            get;
            set;
        }
        public string T3
        {
            get;
            set;
        }
        public string T4
        {
            get;
            set;
        }
        public string T5
        {
            get;
            set;
        }
        public string T6
        {
            get;
            set;
        }
        public string T7
        {
            get;
            set;
        }
        public string T8
        {
            get;
            set;
        }
        public string T9
        {
            get;
            set;
        }
        public string T10
        {
            get;
            set;
        }
        public string T11
        {
            get;
            set;
        }
        public string T12
        {
            get;
            set;
        }
        public string Name
        {
            get;
            set;
        }
        public int rownumber
        {
            get;
            set;
        }
        public string Rdate
        {
            get;
            set;
        }
        public string BanCi
        {
            get;
            set;
        }
        public string OperatorID
        {
            get;
            set;
        }
        public string BanCiID
        {
            get;
            set;
        }
        private DataAccessRefrigeration dar;

        public RefrigerationInfo()
        {
            dar = new DataAccessRefrigeration();
        }

        public DataSet BindList(int start, int end, string strquery)
        {
            return dar.BindList(start, end, strquery);
        }

        public IList<RefrigerationInfo> GetListNew(int pagesize, int startindex, string strquery, out int count)
        {
            IList<RefrigerationInfo> menlist = new List<RefrigerationInfo>();
            RefrigerationInfo meninfo;
            DataSet ds = dar.GetListNew(pagesize, startindex, strquery, out count);
            foreach (DataRow item in ds.Tables[0].Rows)
            {
                meninfo = new RefrigerationInfo()
                {
                    rownumber = Convert.ToInt32(item["rownumber"]),
                    Rdate = item["Rdate"].ToString(),
                    BanCi = item["班次"].ToString(),
                    BanCiID = item["DataFlag"].ToString(),
                    OperatorID = item["OperatorID"].ToString()
                };
                menlist.Add(meninfo);
            }
            return menlist;
        }

        public int SaveRefrigeration(string[,] strs, string datetime, string DataFlag, string OperatorID, string macno, string starttime, string endtime)
        {
            return dar.SaveRefrigeration(strs, datetime, DataFlag, OperatorID, macno, starttime, endtime);
        }
    }
}
